﻿namespace Grow.Scheduler.Job
{
    /// <summary>
    /// Job
    /// </summary>
    public interface IJob
    {
        /// <summary>
        /// 执行方法
        /// </summary>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task ExecuteAsync(CancellationToken cancellationToken);
    }

    /// <summary>
    /// Job
    /// </summary>
    /// <typeparam name="TJobData"></typeparam>
    public interface IJob<TJobData>
    {
        /// <summary>
        /// 执行方法
        /// </summary>
        /// <param name="jobData"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task ExecuteAsync(TJobData jobData, CancellationToken cancellationToken);
    }
}